<?php

class Screen_monitorApp extends BackendApp
{

    function __construct()
    {
        $this->Screen_monitorApp();
    }

    function Screen_monitorApp()
    {
        parent::BackendApp();


    }

    //整车列表
    function index()
    {

        $query = $_GET['Id'];

        if ($query == null || $query == "") {
            $query = "0";
        }
        try {
            $db =& db();
            $sql = "SELECT  * from zys_monitor_define a WHERE a.Id=" . $query . " AND a.Status=1 ";

            $monitor_define = $db->getAll($sql);

            if ($monitor_define) {
                $monitor_define=$monitor_define[0];
                $monitor_define["details"] = array();
                $sql = "SELECT  * from zys_monitor_define_detail a WHERE a.Mid=" . $query . " AND a.Status=1 order by Orders asc,id asc";
                $details = $db->getAll($sql);
                if ($details)
                    foreach ($details as $k => $v) {
                        $monitor_define["details"][] = $v;
                    }
            }
            $this->assign('monitor', $monitor_define);
            $this->assign('monitorJson', ecm_json_encode($monitor_define));
            $this->display('screen_monitor.index.html');
        } catch (Exception $e) {
            $this->show_warning($e->getMessage());
        }
    }

}